package com.fy.core.context;

import com.fy.sys.entity.User;

/**
 * 上下文，存取用户信息
 */
public class AuthContext {

    private static final ThreadLocal<User> context =new ThreadLocal<>();

    //取
    public static void setUser(User user){
        context.set(user);
    }
    //存
    public static User getUser(){
        return context.get();
    }
    //清空
    public static void clear(){
        context.remove();
    }

}
